//
//  LSZDynamicAreaHeadCell.m
//  JKFuYinProject
//
//  Created by 九酷 on 2018/8/22.
//  Copyright © 2018年 LC. All rights reserved.
//

#import "LSZDynamicAreaHeadCell.h"

@implementation LSZDynamicAreaHeadCell
-(id)initWithClassDataArray:(LSZDynamicClassificationManager *)classManager
{
    self = [super init];
    if (self) {
        UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
        CGFloat width = (ScreenWidth-0.001)/4;
        flowLayout.itemSize = CGSizeMake(width,width+15);
        flowLayout.scrollDirection = UICollectionViewScrollDirectionVertical;//水平滚动
        flowLayout.sectionInset = UIEdgeInsetsMake(0, 0, 0, 0);
        flowLayout.minimumLineSpacing = 0;//间距
        flowLayout.minimumInteritemSpacing = 0;
        NSInteger number;
        if (classManager.mutMgArray.count%4 == 0) {
            number = (classManager.mutMgArray.count)/4;
        }else{
            number = (classManager.mutMgArray.count)/4+1;
        }
        LSZDynamicHomepageCollectionView * myCollectionView = [[LSZDynamicHomepageCollectionView alloc]initWithFrame:CGRectMake(0,0 ,ScreenWidth,  ((ScreenWidth-0.001)/4+15)*number) collectionViewLayout:flowLayout];
        self.myCollectionView = myCollectionView;
        myCollectionView.classManager = classManager;
        myCollectionView.scrollsToTop = NO;
        myCollectionView.showsVerticalScrollIndicator = NO;
        myCollectionView.showsHorizontalScrollIndicator = NO;
        [self.contentView addSubview:myCollectionView];
    }
    return self;
}
@end
